<?php
/**
 * @copyright	Copyright (c) 2014 nnc_slide. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
$root_path = JURI::root();
$data = modnnc_slideHelper::getDataSlider();
?>
<div id="ei-slider" class="ei-slider">
    <ul class="ei-slider-large">
        <?php foreach($data as $value):?>
        <?php
            //data big image
            $value_img_obj = json_decode($value->images);
            $big_image['link_image'] = $value_img_obj->image_fulltext;
            $big_image['alt']  = $value_img_obj->image_fulltext_alt;
            $big_image['caption']  = $value_img_obj->image_fulltext_caption;
            $links_article = JRoute::_('index.php?option=com_content&view=article&id='.$value->id);
        ?>
            <li>
            <a href="<?php echo $links_article; ?>">    
                <img src="<?php echo $root_path.$big_image['link_image']; ?>" 
                     alt="<?php echo $big_image['alt']; ?>" 
                     caption="<?php echo $big_image['caption']; ?>" class="responsiveslide">
            </a>
            <div class="ei-title">
                    <h2>CN Solution</h2>
                    <h3><?php echo $big_image['alt']; ?></h3>
            </div>
            </li>   
        <?php endforeach; ?>
    </ul>
    <!--  slider-thumbs -->
    <ul class="ei-slider-thumbs">
        <li class="ei-slider-element">Current</li>
        <?php foreach($data as $value):?>
        <?php
            //data small image
            $value_img_obj = json_decode($value->images);
            $small_image['link_image'] = $value_img_obj->image_intro;
            $small_image['alt']  = $value_img_obj->image_intro_alt;
            $small_image['caption']  = $value_img_obj->image_intro_caption;
        ?>
            <li><a href="#"><?php echo $small_image['alt']; ?></a>
                <img src="<?php echo $root_path.$small_image['link_image']; ?>" 
                     class="slideshowthumb" alt="<?php echo $small_image['alt'] ?>"
                     caption="<?php echo $small_image['caption']; ?>" />
            </li>
        <?php endforeach; ?>
    </ul>	
</div>